<include file="Public/head"/>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Public/sidebar"/>
	<div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <div class="row">
                            <form class="form-inline" action="{:U('index')}" method="get" style="float:left">
								<span class="date_span">
									开始时间：
									<span class="date_span_kj">
										<input class="form-control date_keyword" name="start_date" value="<if condition="
													   $start_date neq '' ">{$start_date}</if>"
												type="text" data-date-format="dd-mm-yyyy" />
										<span class="input-group-addon date_sty">
											<i class="ace-icon fa fa-calendar bigger-110"></i>
										</span>
									</span>
								</span>
								<span class="date_span">
									结束时间：
									<span class="date_span_kj">
										<input class="form-control date_keyword" name="end_date" value="<if condition="
													   $end_date neq '' ">{$end_date}</if>"
												type="text" data-date-format="dd-mm-yyyy" />
										<span class="input-group-addon date_sty">
											<i class="ace-icon fa fa-calendar bigger-110"></i>
										</span>
									</span>
								</span>
								
                                <button type="submit" class="btn btn-purple btn-sm">
                                    <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                                    Search
                                </button>
								<if condition="$user['level'] eq 1 || $UserJurisdiction['if_user_cash'] eq 1">
								&nbsp;&nbsp;
								<a class="btn btn-info btn-add">提现</a>
								</if>
                            </form>
							
                        </div>
                        <div class="space-4"></div>
                        <div class="row">
							<table class="table table-bordered tables">
								<thead>
								<tr>
									<th>推广书籍</th>
								   <th>收益日期</th>
								   <th>充值金额</th>
								   <th>佣金</th>
									<th>分成比例</th>
								</tr>
								</thead>
								<tbody>
								<volist name="data.list" id="vo">
								<tr>
									<td>{$vo.book_title}</td>
									<td>{$vo.create_time|date='Y-m-d H:i:s' , ###}</td>
									<td>{$vo.amount}</td>
									<td>{$vo.get_amount}</td>
									<td>{$vo['get_amount'] / $vo['amount']  *100}%</td>
									
								</tr>
								</volist>
								</tbody>
							</table>
							{$page}
                        </div>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
	<include file="Public/footer"/>
</div><!-- /.main-container -->
<include file="Public/footerjs"/>
<script src="__PUBLIC__/qwadmin/js/date-time/bootstrap-datepicker.js"></script>
<script type="text/javascript">
	$(function () {
		$(".btn-add").on("click" , function(){
			layer.prompt({formType : 0, title : '请输入提现金额'} , function(value,index,element){
				$.post("{:U('Withdraw/hundle')}" , {amount : value} , function(data){
					if(data.status == 1){
						layer.alert(data.msg , function(){
							window.location.reload();
						});
					}else{
						layer.alert(data.msg);
					}
				})
			});
		});
		$('.date_keyword').datepicker({
            format: 'yyyy-mm-dd',
            weekStart: 1,
            autoclose: true,
            todayBtn: 'linked',
            language: 'cn'
        });
	});
	</script>
</body>
</html>